﻿<!DOCTYPE html>
<html lang="de">
    <head>
        <meta charset="utf-8" />
        <title>@ViewBag.Title - StudMap</title>
        <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />
        @Styles.Render("~/Content/css")
        @Scripts.Render("~/bundles/modernizr")
        @RenderSection("styles", false)
    </head>
    <body>
        <header>
            <div class="content-wrapper">
                <div class="float-left">
                    <p class="site-title">
                        @Html.ActionLink("StudMap", "Index", "Home")
                    </p>
                </div>
                <div class="float-right">
                    <section id="login">
                        @Html.Partial("_LoginPartial")
                    </section>
                    <nav>
                        <ul id="menu">
                            @{
                                var r = (RolePrincipal) User;
                                bool isAdmin = false;
                                try
                                {
                                    var rolesArray = new List<string>(r.GetRoles());
                                    isAdmin = rolesArray.Contains("Admins");
                                }
                                catch
                                {
                                }
                            }
                            <li>@Html.ActionLink("Übersicht", "Index", "Home")</li>
                            @if (isAdmin)
                            {
                                <li>@Html.ActionLink("Admin", "Index", "Admin")</li>
                            }
                        </ul>
                    </nav>
                </div>
            </div>
        </header>
        <div id="body">
            <section class="content-wrapper main-content clear-fix">
                @RenderBody()
            </section>
        </div>
        <footer>
            <div class="content-wrapper">
                <div class="float-left">
                    <p>&copy; @DateTime.Now.Year - StudMap</p>
                </div>
            </div>
        </footer>

        @Scripts.Render("~/bundles/jquery")
        <script type="text/javascript">
            var imgBasePath = '@Url.Content("~/Images/")';
            var basePath = '@Url.Content("~/")';
        </script>
        @RenderSection("scripts", required: false)
    </body>
</html>